
<script setup>
import { reactive } from 'vue'
// reactive只能接收对象
// reactive的对象不能够整体赋值 = {   }
const person = reactive({
  name: '张三',
  age: 24,
})
const changeName = () => person.name = '李四'
const changeAge = () => person.age++
</script>

<template>
  <div>{{ person }}</div>
  <button @click="changeName">修改姓名</button>
  <button @click="changeAge">修改年龄</button>
</template>

<style scoped></style>